package com.lzp.wechat.controller;

import com.lzp.wechat.service.MessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@Api(tags = "基础消息接口")
public class MessageController {

    @Autowired
    private MessageService messageService;

    @PostMapping(value = "/wechat")
    @ApiOperation(value = "接收消息并回复", notes = "接收消息并回复")
    public String textMessage(HttpServletRequest request, HttpServletResponse response) {
        String returnMessage = messageService.messageHandle(request, response);
        return returnMessage;
    }

}
